<?php

/**
 * LigneReglement form base class.
 *
 * @method LigneReglement getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLigneReglementForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'numero_piece'         => new sfWidgetFormInputText(),
      'banque'               => new sfWidgetFormInputText(),
      'montant'              => new sfWidgetFormInputText(),
      'date'                 => new sfWidgetFormDate(),
      'date_prise_en_charge' => new sfWidgetFormDate(),
      'date_echeance'        => new sfWidgetFormDate(),
      'verser'               => new sfWidgetFormInputCheckbox(),
      'valide'               => new sfWidgetFormInputCheckbox(),
      'etat'                 => new sfWidgetFormInputCheckbox(),
      'reglement_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ReglementClient'), 'add_empty' => true)),
      'id_mode_reglement'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'add_empty' => true)),
      'id_organisme'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Organisme'), 'add_empty' => true)),
      'id_caisse'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Caisse'), 'add_empty' => true)),
      'id_compte_bancaire'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CompteBancaire'), 'add_empty' => true)),
      'id_retenue_source'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('RetenueSource'), 'add_empty' => true)),
      'journal_caisse'       => new sfWidgetFormInputCheckbox(),
      'facture_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureClient'), 'add_empty' => true)),
      'bon_livraison_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonClient'), 'add_empty' => true)),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
      'deleted_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'numero_piece'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'banque'               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'montant'              => new sfValidatorNumber(array('required' => false)),
      'date'                 => new sfValidatorDate(),
      'date_prise_en_charge' => new sfValidatorDate(array('required' => false)),
      'date_echeance'        => new sfValidatorDate(array('required' => false)),
      'verser'               => new sfValidatorBoolean(),
      'valide'               => new sfValidatorBoolean(),
      'etat'                 => new sfValidatorBoolean(),
      'reglement_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ReglementClient'), 'required' => false)),
      'id_mode_reglement'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'required' => false)),
      'id_organisme'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Organisme'), 'required' => false)),
      'id_caisse'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Caisse'), 'required' => false)),
      'id_compte_bancaire'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CompteBancaire'), 'required' => false)),
      'id_retenue_source'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('RetenueSource'), 'required' => false)),
      'journal_caisse'       => new sfValidatorBoolean(array('required' => false)),
      'facture_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FactureClient'), 'required' => false)),
      'bon_livraison_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonClient'), 'required' => false)),
      'created_at'           => new sfValidatorDateTime(),
      'updated_at'           => new sfValidatorDateTime(),
      'deleted_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ligne_reglement[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneReglement';
  }

}
